{% if allMessages.page %}
<div class="container">
        <ul class="pagination">
        {% set urlnav = request.path %}
        {% set url = request.path %}
        {% set urlnav = url_for('main_bp.messages', page=page) %}
        {% for page in allMessages.iter_pages() %}
           {% if page %}
            {% if page == allMessages.page %}
               <li class="page-item"><a class="page-link" style="color: #123c69;" href="?page={{page}}"> {{ page }} </a></li>
            {% else %}
                <li class="page-item"><a class="page-link" style="color: #123c69;" href="?page={{page}}">{{ page }}</a></li>
            {% endif %}
        {% else %}
            <span class="nav_ext">...</span>
        {% endif %}
        {% endfor %}
        </ul>
</div>
{% endif %}
